package atm.com.util;

import java.util.Map;

public class AjaxResult {
    private boolean suc = true;
    private String msg = "操作成功!";
    //返回到前台对象
    private Object resultObj;

    public boolean issuc() {
        return suc;
    }
    public AjaxResult(boolean suc,String msg,Map map){
        this.suc=suc;
        this.msg=msg;
        this.resultObj=map;
    }

    public AjaxResult setsuc(boolean suc) {
        this.suc = suc;
        return this;
    }

    public String getmsg() {
        return msg;
    }

    public AjaxResult setmsg(String msg) {
        this.msg = msg;
        return this;
    }

    public Object getResultObj() {
        return resultObj;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

    //AjaxResult.me()成功
    //AjaxResult.me().setMessage()成功
    //AjaxResult.me().setsuc(false),setMessage("失败");
    public  static AjaxResult me(){
        return new AjaxResult();
    }


    //成功
    public AjaxResult() {
    }
    //失败并且有提示
    public AjaxResult(String msg) {
        this.suc = false;
        this.msg = msg;
    }
}